using System;
using System.Data;
using System.Data.SqlTypes;
using System.Data.SqlClient;

namespace DataEntity
{
    public class T_Report_SalesAlone : DBInteractionBase
	{
		#region Class Member Declarations
			private SqlDateTime		_report_SalesAlone_LentDate, _report_SalesAlone_BigDate, _report_SalesAlone_ContractDate, _report_SalesAlone_ContractLoansDate, _report_SalesAlone_GiveHouseDate, _report_SalesAlone_ExchangeDate;
			private SqlInt32		_report_SalesAlone_ExchangeTypeID, _report_Plan_Audit, _report_SalesAlone_PropertyTypeID;
			private SqlDecimal		_report_SalesAlone_ContractSumPrice, _report_SalesAlone_ContractPrice, _report_SalesAlone_ContractArea, _report_SalesAlone_SalesArea, _report_SalesAlone_OriginalContractPrice, _report_SalesAlone_BigSumPrice, _report_SalesAlone_BigPrice, _report_SalesAlone_LentAmount, _report_SalesAlone_Area, _report_SalesAlone_RestHouse, _report_SalesAlone_TotalReceipt, _report_SalesAlone_LoanAmount, _report_SalesAlone_AgencyCost, _report_SalesAlone_CancelComm, _report_SalesAlone_Price, _report_SalesAlone_Margins;
			private SqlString		_report_SalesAlone_SellUnit, _report_SalesAlone_Buyer, _report_SalesAlone_Discount, _report_SalesAlone_ReportNO, _report_SalesAlone_Subscribe, _report_SalesAlone_Operator, _report_SalesAlone_PayType, _report_SalesAlone_Tel, _report_SalesAlone_CustomerAddress, _report_SalesAlone_PostCode, _report_SalesAlone_Remark, _report_SalesAlone_Variations, _report_SalesAlone_IDNumber;
            private SqlGuid         _report_SalesAlone_ID, _report_SalesAlone_ProjectID;
		#endregion


		public T_Report_SalesAlone()
		{
			// Nothing for now.
		}




		public override DataTable SelectAll()
		{
			SqlCommand	cmdToExecute = new SqlCommand();
			cmdToExecute.CommandText = "dbo.[sp_t_Report_SalesAlone_SelectAll]";
			cmdToExecute.CommandType = CommandType.StoredProcedure;
			DataTable toReturn = new DataTable("t_Report_SalesAlone");
			SqlDataAdapter adapter = new SqlDataAdapter(cmdToExecute);

			// Use base class' connection object
			cmdToExecute.Connection = _mainConnection;

			try
			{

				if(_mainConnectionIsCreatedLocal)
				{
					// Open connection.
					_mainConnection.Open();
				}
				else
				{
					if(_mainConnectionProvider.IsTransactionPending)
					{
						cmdToExecute.Transaction = _mainConnectionProvider.CurrentTransaction;
					}
				}

				// Execute query.
				adapter.Fill(toReturn);
				return toReturn;
			}
			catch(Exception ex)
			{
				// some error occured. Bubble it to caller and encapsulate Exception object
				throw new Exception("T_Report_SalesAlone::SelectAll::Error occured.", ex);
			}
			finally
			{
				if(_mainConnectionIsCreatedLocal)
				{
					// Close connection.
					_mainConnection.Close();
				}
				cmdToExecute.Dispose();
				adapter.Dispose();
			}
		}


		#region Class Property Declarations
		public SqlGuid Report_SalesAlone_ID
		{
			get
			{
				return _report_SalesAlone_ID;
			}
			set
			{
				SqlGuid report_SalesAlone_IDTmp = (SqlGuid)value;
				if(report_SalesAlone_IDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ID", "Report_SalesAlone_ID can't be NULL");
				}
				_report_SalesAlone_ID = value;
			}
		}

        public SqlGuid Report_SalesAlone_ProjectID
        {
            get
            {
                return _report_SalesAlone_ProjectID;
            }
            set
            {
                _report_SalesAlone_ProjectID = value;
            }
        }


		public SqlInt32 Report_SalesAlone_ExchangeTypeID
		{
			get
			{
				return _report_SalesAlone_ExchangeTypeID;
			}
			set
			{
				SqlInt32 report_SalesAlone_ExchangeTypeIDTmp = (SqlInt32)value;
				if(report_SalesAlone_ExchangeTypeIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ExchangeTypeID", "Report_SalesAlone_ExchangeTypeID can't be NULL");
				}
				_report_SalesAlone_ExchangeTypeID = value;
			}
		}


		public SqlInt32 Report_SalesAlone_PropertyTypeID
		{
			get
			{
				return _report_SalesAlone_PropertyTypeID;
			}
			set
			{
				SqlInt32 report_SalesAlone_PropertyTypeIDTmp = (SqlInt32)value;
				if(report_SalesAlone_PropertyTypeIDTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_PropertyTypeID", "Report_SalesAlone_PropertyTypeID can't be NULL");
				}
				_report_SalesAlone_PropertyTypeID = value;
			}
		}


		public SqlDateTime Report_SalesAlone_ExchangeDate
		{
			get
			{
				return _report_SalesAlone_ExchangeDate;
			}
			set
			{
				SqlDateTime report_SalesAlone_ExchangeDateTmp = (SqlDateTime)value;
				if(report_SalesAlone_ExchangeDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ExchangeDate", "Report_SalesAlone_ExchangeDate can't be NULL");
				}
				_report_SalesAlone_ExchangeDate = value;
			}
		}


		public SqlString Report_SalesAlone_ReportNO
		{
			get
			{
				return _report_SalesAlone_ReportNO;
			}
			set
			{
				SqlString report_SalesAlone_ReportNOTmp = (SqlString)value;
				if(report_SalesAlone_ReportNOTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ReportNO", "Report_SalesAlone_ReportNO can't be NULL");
				}
				_report_SalesAlone_ReportNO = value;
			}
		}


		public SqlString Report_SalesAlone_Subscribe
		{
			get
			{
				return _report_SalesAlone_Subscribe;
			}
			set
			{
				SqlString report_SalesAlone_SubscribeTmp = (SqlString)value;
				if(report_SalesAlone_SubscribeTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Subscribe", "Report_SalesAlone_Subscribe can't be NULL");
				}
				_report_SalesAlone_Subscribe = value;
			}
		}


		public SqlString Report_SalesAlone_Operator
		{
			get
			{
				return _report_SalesAlone_Operator;
			}
			set
			{
				SqlString report_SalesAlone_OperatorTmp = (SqlString)value;
				if(report_SalesAlone_OperatorTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Operator", "Report_SalesAlone_Operator can't be NULL");
				}
				_report_SalesAlone_Operator = value;
			}
		}


		public SqlString Report_SalesAlone_SellUnit
		{
			get
			{
				return _report_SalesAlone_SellUnit;
			}
			set
			{
				SqlString report_SalesAlone_SellUnitTmp = (SqlString)value;
				if(report_SalesAlone_SellUnitTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_SellUnit", "Report_SalesAlone_SellUnit can't be NULL");
				}
				_report_SalesAlone_SellUnit = value;
			}
		}


		public SqlString Report_SalesAlone_Buyer
		{
			get
			{
				return _report_SalesAlone_Buyer;
			}
			set
			{
				SqlString report_SalesAlone_BuyerTmp = (SqlString)value;
				if(report_SalesAlone_BuyerTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Buyer", "Report_SalesAlone_Buyer can't be NULL");
				}
				_report_SalesAlone_Buyer = value;
			}
		}


		public SqlDecimal Report_SalesAlone_Area
		{
			get
			{
				return _report_SalesAlone_Area;
			}
			set
			{
				SqlDecimal report_SalesAlone_AreaTmp = (SqlDecimal)value;
				if(report_SalesAlone_AreaTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Area", "Report_SalesAlone_Area can't be NULL");
				}
				_report_SalesAlone_Area = value;
			}
		}


		public SqlString Report_SalesAlone_Discount
		{
			get
			{
				return _report_SalesAlone_Discount;
			}
			set
			{
				SqlString report_SalesAlone_DiscountTmp = (SqlString)value;
				if(report_SalesAlone_DiscountTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Discount", "Report_SalesAlone_Discount can't be NULL");
				}
				_report_SalesAlone_Discount = value;
			}
		}


		public SqlString Report_SalesAlone_PayType
		{
			get
			{
				return _report_SalesAlone_PayType;
			}
			set
			{
				SqlString report_SalesAlone_PayTypeTmp = (SqlString)value;
				if(report_SalesAlone_PayTypeTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_PayType", "Report_SalesAlone_PayType can't be NULL");
				}
				_report_SalesAlone_PayType = value;
			}
		}


		public SqlDecimal Report_SalesAlone_Price
		{
			get
			{
				return _report_SalesAlone_Price;
			}
			set
			{
				SqlDecimal report_SalesAlone_PriceTmp = (SqlDecimal)value;
				if(report_SalesAlone_PriceTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Price", "Report_SalesAlone_Price can't be NULL");
				}
				_report_SalesAlone_Price = value;
			}
		}


		public SqlDecimal Report_SalesAlone_Margins
		{
			get
			{
				return _report_SalesAlone_Margins;
			}
			set
			{
				SqlDecimal report_SalesAlone_MarginsTmp = (SqlDecimal)value;
				if(report_SalesAlone_MarginsTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Margins", "Report_SalesAlone_Margins can't be NULL");
				}
				_report_SalesAlone_Margins = value;
			}
		}


		public SqlDecimal Report_SalesAlone_AgencyCost
		{
			get
			{
				return _report_SalesAlone_AgencyCost;
			}
			set
			{
				SqlDecimal report_SalesAlone_AgencyCostTmp = (SqlDecimal)value;
				if(report_SalesAlone_AgencyCostTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_AgencyCost", "Report_SalesAlone_AgencyCost can't be NULL");
				}
				_report_SalesAlone_AgencyCost = value;
			}
		}


		public SqlDecimal Report_SalesAlone_CancelComm
		{
			get
			{
				return _report_SalesAlone_CancelComm;
			}
			set
			{
				SqlDecimal report_SalesAlone_CancelCommTmp = (SqlDecimal)value;
				if(report_SalesAlone_CancelCommTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_CancelComm", "Report_SalesAlone_CancelComm can't be NULL");
				}
				_report_SalesAlone_CancelComm = value;
			}
		}


		public SqlString Report_SalesAlone_Remark
		{
			get
			{
				return _report_SalesAlone_Remark;
			}
			set
			{
				SqlString report_SalesAlone_RemarkTmp = (SqlString)value;
				if(report_SalesAlone_RemarkTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Remark", "Report_SalesAlone_Remark can't be NULL");
				}
				_report_SalesAlone_Remark = value;
			}
		}


		public SqlString Report_SalesAlone_Variations
		{
			get
			{
				return _report_SalesAlone_Variations;
			}
			set
			{
				SqlString report_SalesAlone_VariationsTmp = (SqlString)value;
				if(report_SalesAlone_VariationsTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Variations", "Report_SalesAlone_Variations can't be NULL");
				}
				_report_SalesAlone_Variations = value;
			}
		}


		public SqlString Report_SalesAlone_IDNumber
		{
			get
			{
				return _report_SalesAlone_IDNumber;
			}
			set
			{
				SqlString report_SalesAlone_IDNumberTmp = (SqlString)value;
				if(report_SalesAlone_IDNumberTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_IDNumber", "Report_SalesAlone_IDNumber can't be NULL");
				}
				_report_SalesAlone_IDNumber = value;
			}
		}


		public SqlString Report_SalesAlone_Tel
		{
			get
			{
				return _report_SalesAlone_Tel;
			}
			set
			{
				SqlString report_SalesAlone_TelTmp = (SqlString)value;
				if(report_SalesAlone_TelTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_Tel", "Report_SalesAlone_Tel can't be NULL");
				}
				_report_SalesAlone_Tel = value;
			}
		}


		public SqlString Report_SalesAlone_CustomerAddress
		{
			get
			{
				return _report_SalesAlone_CustomerAddress;
			}
			set
			{
				SqlString report_SalesAlone_CustomerAddressTmp = (SqlString)value;
				if(report_SalesAlone_CustomerAddressTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_CustomerAddress", "Report_SalesAlone_CustomerAddress can't be NULL");
				}
				_report_SalesAlone_CustomerAddress = value;
			}
		}


		public SqlString Report_SalesAlone_PostCode
		{
			get
			{
				return _report_SalesAlone_PostCode;
			}
			set
			{
				SqlString report_SalesAlone_PostCodeTmp = (SqlString)value;
				if(report_SalesAlone_PostCodeTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_PostCode", "Report_SalesAlone_PostCode can't be NULL");
				}
				_report_SalesAlone_PostCode = value;
			}
		}


		public SqlDecimal Report_SalesAlone_SalesArea
		{
			get
			{
				return _report_SalesAlone_SalesArea;
			}
			set
			{
				SqlDecimal report_SalesAlone_SalesAreaTmp = (SqlDecimal)value;
				if(report_SalesAlone_SalesAreaTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_SalesArea", "Report_SalesAlone_SalesArea can't be NULL");
				}
				_report_SalesAlone_SalesArea = value;
			}
		}


		public SqlDecimal Report_SalesAlone_OriginalContractPrice
		{
			get
			{
				return _report_SalesAlone_OriginalContractPrice;
			}
			set
			{
				SqlDecimal report_SalesAlone_OriginalContractPriceTmp = (SqlDecimal)value;
				if(report_SalesAlone_OriginalContractPriceTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_OriginalContractPrice", "Report_SalesAlone_OriginalContractPrice can't be NULL");
				}
				_report_SalesAlone_OriginalContractPrice = value;
			}
		}


		public SqlDateTime Report_SalesAlone_BigDate
		{
			get
			{
				return _report_SalesAlone_BigDate;
			}
			set
			{
				SqlDateTime report_SalesAlone_BigDateTmp = (SqlDateTime)value;
				if(report_SalesAlone_BigDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_BigDate", "Report_SalesAlone_BigDate can't be NULL");
				}
				_report_SalesAlone_BigDate = value;
			}
		}


		public SqlDecimal Report_SalesAlone_BigPrice
		{
			get
			{
				return _report_SalesAlone_BigPrice;
			}
			set
			{
				SqlDecimal report_SalesAlone_BigPriceTmp = (SqlDecimal)value;
				if(report_SalesAlone_BigPriceTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_BigPrice", "Report_SalesAlone_BigPrice can't be NULL");
				}
				_report_SalesAlone_BigPrice = value;
			}
		}


		public SqlDecimal Report_SalesAlone_BigSumPrice
		{
			get
			{
				return _report_SalesAlone_BigSumPrice;
			}
			set
			{
				SqlDecimal report_SalesAlone_BigSumPriceTmp = (SqlDecimal)value;
				if(report_SalesAlone_BigSumPriceTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_BigSumPrice", "Report_SalesAlone_BigSumPrice can't be NULL");
				}
				_report_SalesAlone_BigSumPrice = value;
			}
		}


		public SqlDateTime Report_SalesAlone_ContractDate
		{
			get
			{
				return _report_SalesAlone_ContractDate;
			}
			set
			{
				SqlDateTime report_SalesAlone_ContractDateTmp = (SqlDateTime)value;
				if(report_SalesAlone_ContractDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ContractDate", "Report_SalesAlone_ContractDate can't be NULL");
				}
				_report_SalesAlone_ContractDate = value;
			}
		}


		public SqlDecimal Report_SalesAlone_ContractArea
		{
			get
			{
				return _report_SalesAlone_ContractArea;
			}
			set
			{
				SqlDecimal report_SalesAlone_ContractAreaTmp = (SqlDecimal)value;
				if(report_SalesAlone_ContractAreaTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ContractArea", "Report_SalesAlone_ContractArea can't be NULL");
				}
				_report_SalesAlone_ContractArea = value;
			}
		}


		public SqlDecimal Report_SalesAlone_ContractPrice
		{
			get
			{
				return _report_SalesAlone_ContractPrice;
			}
			set
			{
				SqlDecimal report_SalesAlone_ContractPriceTmp = (SqlDecimal)value;
				if(report_SalesAlone_ContractPriceTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ContractPrice", "Report_SalesAlone_ContractPrice can't be NULL");
				}
				_report_SalesAlone_ContractPrice = value;
			}
		}


		public SqlDecimal Report_SalesAlone_ContractSumPrice
		{
			get
			{
				return _report_SalesAlone_ContractSumPrice;
			}
			set
			{
				SqlDecimal report_SalesAlone_ContractSumPriceTmp = (SqlDecimal)value;
				if(report_SalesAlone_ContractSumPriceTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ContractSumPrice", "Report_SalesAlone_ContractSumPrice can't be NULL");
				}
				_report_SalesAlone_ContractSumPrice = value;
			}
		}


		public SqlDecimal Report_SalesAlone_LoanAmount
		{
			get
			{
				return _report_SalesAlone_LoanAmount;
			}
			set
			{
				SqlDecimal report_SalesAlone_LoanAmountTmp = (SqlDecimal)value;
				if(report_SalesAlone_LoanAmountTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_LoanAmount", "Report_SalesAlone_LoanAmount can't be NULL");
				}
				_report_SalesAlone_LoanAmount = value;
			}
		}


		public SqlDateTime Report_SalesAlone_ContractLoansDate
		{
			get
			{
				return _report_SalesAlone_ContractLoansDate;
			}
			set
			{
				SqlDateTime report_SalesAlone_ContractLoansDateTmp = (SqlDateTime)value;
				if(report_SalesAlone_ContractLoansDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_ContractLoansDate", "Report_SalesAlone_ContractLoansDate can't be NULL");
				}
				_report_SalesAlone_ContractLoansDate = value;
			}
		}


		public SqlDateTime Report_SalesAlone_LentDate
		{
			get
			{
				return _report_SalesAlone_LentDate;
			}
			set
			{
				SqlDateTime report_SalesAlone_LentDateTmp = (SqlDateTime)value;
				if(report_SalesAlone_LentDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_LentDate", "Report_SalesAlone_LentDate can't be NULL");
				}
				_report_SalesAlone_LentDate = value;
			}
		}


		public SqlDecimal Report_SalesAlone_LentAmount
		{
			get
			{
				return _report_SalesAlone_LentAmount;
			}
			set
			{
				SqlDecimal report_SalesAlone_LentAmountTmp = (SqlDecimal)value;
				if(report_SalesAlone_LentAmountTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_LentAmount", "Report_SalesAlone_LentAmount can't be NULL");
				}
				_report_SalesAlone_LentAmount = value;
			}
		}


		public SqlDecimal Report_SalesAlone_TotalReceipt
		{
			get
			{
				return _report_SalesAlone_TotalReceipt;
			}
			set
			{
				SqlDecimal report_SalesAlone_TotalReceiptTmp = (SqlDecimal)value;
				if(report_SalesAlone_TotalReceiptTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_TotalReceipt", "Report_SalesAlone_TotalReceipt can't be NULL");
				}
				_report_SalesAlone_TotalReceipt = value;
			}
		}


		public SqlDecimal Report_SalesAlone_RestHouse
		{
			get
			{
				return _report_SalesAlone_RestHouse;
			}
			set
			{
				SqlDecimal report_SalesAlone_RestHouseTmp = (SqlDecimal)value;
				if(report_SalesAlone_RestHouseTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_RestHouse", "Report_SalesAlone_RestHouse can't be NULL");
				}
				_report_SalesAlone_RestHouse = value;
			}
		}


		public SqlDateTime Report_SalesAlone_GiveHouseDate
		{
			get
			{
				return _report_SalesAlone_GiveHouseDate;
			}
			set
			{
				SqlDateTime report_SalesAlone_GiveHouseDateTmp = (SqlDateTime)value;
				if(report_SalesAlone_GiveHouseDateTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_SalesAlone_GiveHouseDate", "Report_SalesAlone_GiveHouseDate can't be NULL");
				}
				_report_SalesAlone_GiveHouseDate = value;
			}
		}


		public SqlInt32 Report_Plan_Audit
		{
			get
			{
				return _report_Plan_Audit;
			}
			set
			{
				SqlInt32 report_Plan_AuditTmp = (SqlInt32)value;
				if(report_Plan_AuditTmp.IsNull)
				{
					throw new ArgumentOutOfRangeException("Report_Plan_Audit", "Report_Plan_Audit can't be NULL");
				}
				_report_Plan_Audit = value;
			}
		}
		#endregion
	}
}
